package de.gwtprime.client.activities;

import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;

import de.gwtprime.client.ClientFactory;
import de.gwtprime.client.viewsStatic.NavigationView;

public class NavigationActivity extends AbstractActivity implements NavigationView.Presenter{

	
	private ClientFactory clientFactory;
	
	public NavigationActivity(ClientFactory clientFactory) {
		this.clientFactory = clientFactory;
		NavigationView navigationView = clientFactory.getNavigationView();
		navigationView.setPresenter(this);
		navigationView.setName("Home");
		navigationView.setClientFactory(clientFactory);
	
	}
	
	@Override
	public void start(AcceptsOneWidget panel, EventBus eventBus) {
		NavigationView welcomeView = clientFactory.getNavigationView();
		welcomeView.setPresenter(this);
		welcomeView.setName("Home");

	}

	@Override
	public void goTo(Place place) {
		clientFactory.getPlaceController().goTo(place);
	}

}
